package zilvic.game;

import java.awt.Graphics;
import zilvic.game.room.Room;
import zilvic.game.character.Character;

/**
 *
 * @author Duncan
 */
public class Game {
    private boolean gameRunning        = true;
    private boolean waitingForKeyPress = true;
    private boolean leftPressed        = false;
    private boolean rightPressed       = false;

    private static Game g;
    private static KeyInputHandler input;

    private Character player;
    private Room room;

    public final static byte GRID_SIZE = 20;

    public Game() {

    }

    public void gameStart() {
        // Clear all entities from the world.

        // Reset the game field

        // Reset any keyboard actions still beeing pressed.

        // Setup all basic data

        // If a load-file has been loaded, apply changes to the world.
    }

    public void setRoom(int roomId, int status) {

    }

    public Room getRoom() {
        return this.room;
    }

    public Character getPlayer() {
        return this.player;
    }

    public void gameLoop(long delta) {
        // If a room-change has been requested, change room.

        // Apply menu-logic

        // Update all entity-positions.
    }

    public void gameDraw(Graphics g) {
        // Draw the current frame.
    }

    public void gameEnd() {

    }

    public static Game getInstance() {
        return g;
    }

    public static KeyInputHandler getInputHandler() {
        return input;
    }
}
